<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增出入库表单</title>
</head>
<body>
<script>
    $(function () {
        //确认提交表单
        $("#newIOlog-save").linkbutton({onClick:function () {
            if($("#iotype").combobox("getValue")!=0){
                $("#newIOlog-form").form({
                    method:'post',
                    onSubmit:function () {
                        return $(this).form("validate");
                    },
                    success:function (data) {
                        var data = eval("("+data+")");
                        if(data.success){
                            $("#newIOlog-form").form("clear");
                            $("#newIO").dialog("close");
                            $.messager.alert("success","确认成功!","info");
                            $("#iodg").datagrid({
                                url:'allIOlogPaged',
                                method:'post'
                            });
                            $("#iodg").datagrid("reload");
                        }else{
                            $.messager.alert("failed",data.message,"error");
                        }
                    }
                }).submit();
            }else{
                $.messager.alert("failed","请选择出入库类型！","error");
            }
            }});

        $("#newIOlog-close").linkbutton({onClick:function () {
                $("#newIO").dialog("close");
            }});

        $("#iotype").combobox({
            onChange:function (newValue,oldValue) {
                var queryParams = $("#ioDispather").combogrid('options').queryParams;
                queryParams.iotype = $("#iotype").val();
            }
        });

    });
</script>
<div>
    <form id="newIOlog-form" action="newIOlog-form-sub" method="post">
        <div class="div-title-hut"> --------------------------------<span class="span-title">确认出/入库信息</span>---------------------------</div>
        <div class="ddn">
            <input  name="iotitle" class="easyui-textbox" data-options="label:'标题',required:true,width:300"><div style="width: 25px;display: inline-block"></div>
            <select id="iotype" name="iotype" class="easyui-combobox" data-options="label:'类型',panelHeight:60,editable:false,required:true,width:300">
                <option value="0">请选择</option>
                <option value="1">订单出库</option>
                <option value="2">采购入库</option>
                <option value="3">退货入库</option>
                <option value="4">退货出库</option>
            </select>
        </div>
        <div class="ddn">
            <select id="ioDispather" name="ioDispatherId" class="easyui-combogrid" data-options="required:true,prompt:'模糊出/入库编号及主题',url:'getAllpurOrorderBymh',
        label:'出/入库单',panelWidth:355,idField:'ioDispatherId',textField:'ioDispatherTitle',method:'post',editable:true,panelHeight:'auto',width:300,mode:'remote',
            columns:[[
                {field:'ioDispatherId',title:'出入库编号',width:100},
                {field:'ioDispatherTitle',title:'出入库对应订单/采购标题',width:200}
            ]]" ></select><div style="width: 25px;display: inline-block"></div>
            <select id="searchUserBypiny" class="easyui-combogrid" name="handmanId" style="width:300px;"
                    data-options="
            label:'经手人',
            panelWidth:330,
            prompt:'模糊经手人名称或昵称',
            required:true,
            panelHeight:'auto',
            idField:'handmanId',
            textField:'handman',
            mode:'remote',
            method:'post',
            url:'findUserBypiny',
            columns:[[
                {field:'handmanId',title:'经手人编号',width:60},
                {field:'nickname',title:'经手人昵称',width:100},
                {field:'handman',title:'经手人实名',width:100}
            ]]
        "></select>
        </div>
        <div class="ddn">
            <input  name="iorid" class="easyui-combobox" data-options="label:'仓库名称:',required:true,width:300,
            valueField:'rid',
            textField:'rname',url:'findAllR',panelHeight:100"><div style="width: 25px;display: inline-block"></div>
            <input id="ioDate" name="ioDate" class="easyui-datebox" data-options="label:'出/入库日期',required:true,width:300">
        </div>
        <div class="btn ddn">
            <!--此按钮可根据自己业务自行修改或删除-->
            <a id="newIOlog-save" class="easyui-linkbutton " data-options="iconCls:'icon-ok2'">确认</a><div style="width: 20px;display: inline-block"></div>
            <a id="newIOlog-close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel2'">取消</a>
        </div>
    </form>
</div>
</body>
</html>
